package swingTest;

import cn.dragon.eatingfish.MouseAdp;

import javax.swing.*;
import java.awt.*;

public class MoveTest {

    public static void main(String[] args) throws AWTException {
        JFrame jf = new JFrame("测试窗口");
        jf.setSize(1400, 700);
        jf.setLocationRelativeTo(null);
        jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        jf.setLayout(null);
        ImageIcon imageIcon = new ImageIcon("images/testImg.jpeg");
        Image image = imageIcon.getImage();
        JLabel label = new JLabel(imageIcon);


        MouseAdp adp = new MouseAdp();
        jf.addMouseListener(adp);          // 添加鼠标监听事件（点击）
        jf.addMouseMotionListener(adp);    // 添加
        label.setBounds(adp.x,adp.y,1400,700);
        jf.add(label);
        jf.setVisible(true);
    }

}
